import QtQuick 2.12
import QtQuick.Controls 2.5

Popup {
    id: tip
//    x:0
//    y:0
    height: 30
    background:
    Rectangle{
//    id: tip
        //visible: false
        anchors.topMargin: 0
        anchors.leftMargin: 0
    //width: 1600
        height: 30
        color: "ivory"
        //property string m_tip: ""
        Text {
            id: msgtext
            anchors.centerIn: parent
//            text: m_tip
            color: "royalblue"

        }

//        function delay(delayTime) {
//            timer = new Timer();
//            timer.interval = delayTime;
//            timer.repeat = false;
//            timer.start();

//        }

    }

    Timer {
        id: timer
        running: false
        repeat: false
        interval: 2000
    //property var callback

        onTriggered: hidemsg()
    }
    function showmsg(msg) {
        msgtext.text = msg
        tip.open()
        timer.start()
        //tip.visible = false;


    }
    function hidemsg() {
        tip.close()
    }
}
